<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <script type="text/javascript">
            function doPopupWindow(obj) {
                var pkid = obj.parentNode.parentNode.parentNode.getAttribute("data-rk");
                var popupwindow = window.open("common/actInfoForm.xhtml?pkid=" + pkid, "", "height=600,width=800,left=200,top=100,toolbar=no,menubar=no,scrollbars=yes,location=no");
                popupwindow.focus;
            }
        </script>
        <style type="text/css">
            .col-95 {
                width: 95%;
            }

            .col-5 {
                width: 5%;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <p:tabView id="tabview" dynamic="true" cache="false" style="font-weight:normal;font-style:normal">
                <p:tab title="商户信息查询">
                    <h:form>
                        <div id="qrytable">
                            <p:growl id="msgs" showDetail="false"/>
                            <p:panel style="margin-top:10px">
                                <h:panelGrid columns="2" cellspacing="5" columnClasses="col-95,col-5">
                                    <h:panelGrid columns="4" cellspacing="5" style="text-align: right;">
                                        <h:outputLabel value="商户号:"/>
                                        <p:inputText value="#{cdtMchAction.qryMchNo}" size="30"/>
                                        <h:outputLabel value="商户名称:"/>
                                        <p:inputText value="#{cdtMchAction.qryMchName}" size="30"/>
                                    </h:panelGrid>
                                    <h:panelGrid>
                                        <p:commandButton style="width:90px;" value="查询"
                                                         action="#{cdtMchAction.onQuery}"
                                                         update="pdt,msgs">
                                        </p:commandButton>
                                    </h:panelGrid>
                                </h:panelGrid>
                            </p:panel>
                            <p:dataTable id="pdt" dynamic="true" style="width:100%;"
                                         value="#{cdtMchAction.mchList}" var="record"
                                         rowKey="#{record.pkid}"
                                         selection="#{cdtMchAction.selectedMchRecords}"
                                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                         paginator="true" rows="15" paginatorPosition="bottom"
                                         rowsPerPageTemplate="100,50,30,15,5"
                                         emptyMessage="没有查询到数据记录...">
                                <p:column selectionMode="multiple" style="width:18px"/>
                                <p:column headerText="商户号" style="text-align: center">
                                    <h:outputText value="#{record.mchnum}"/>
                                </p:column>
                                <p:column headerText="商户名称" style="text-align: right">
                                    <h:outputText value="#{record.mchname}"/>
                                </p:column>
                                <p:column headerText="法人姓名">
                                    <h:outputText value="#{record.bosname}" style="float: right"/>
                                </p:column>
                                <p:column headerText="商户状态" style="text-align: center">
                                    <h:outputText value="#{cdtMchAction.mchStatus.valueOfAlias(record.mchsts).title}"/>
                                </p:column>
                                <p:column headerText="建立日期" style="text-align: center">
                                    <h:outputText value="#{record.opendate}"/>
                                </p:column>
                                <p:columnGroup type="footer">
                                    <p:row>
                                        <p:column colspan="10"
                                                  footerText="共查询到#{fn:length(cdtMchAction.mchList)}笔记录"
                                                  style="text-align:right"/>
                                    </p:row>
                                </p:columnGroup>
                            </p:dataTable>
                        </div>
                    </h:form>
                </p:tab>
            </p:tabView>
        </div>
    </ui:define>
</ui:composition>